$(function() {
	$('#hdxxfile').on('change', function() {
		var fileNames = '';
		$.each(this.files, function() {
			fileNames += '<span class="am-badge">' + this.name + '</span> ';
		});
		var filepath = $("input[name='hdxxfile']").val();
		var extStart = filepath.lastIndexOf(".");
		var ext = filepath.substring(extStart, filepath.length).toUpperCase();
		if (ext != ".XLS" && ext != ".XLSX") {
			alert("文件限于xls,xlsx格式");
			return false;
		}
		$('#hdxxfile-list').html(fileNames);
		return true;
	});
})

/** 日期比较 **/
function compareDate(strDate1,strDate2)
{
    var date1 = new Date(strDate1.replace(/\-/g, "\/"));
    var date2 = new Date(strDate2.replace(/\-/g, "\/"));
    return date1-date2;
}

function addzero(s) {
    return s < 10 ? '0' + s: s;
}